<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>JavaScript学习-对话框</title>
	
	<script type="text/javascript" >
	function ClickError(){
		alert("注意！！！");
	}
	
	function ClickConfirm(){
	var result=confirm("你确认？");
		if (result==true) {
			document.getElementById('confirm_result').innerHTML="确认";
		} else {
			document.getElementById('confirm_result').innerHTML="取消";
		}
		
	}
	
	function ClickPrompt(){
		var result=prompt('请输入','123');
		document.getElementById('prompt_result').innerHTML=result;
	}
	
	</script>
</head>
<body>
<button id="show_error" onclick="ClickError()">警告提示</button>
<br>
<button id="show_confirm" onclick="ClickConfirm()">确认提示</button>
<p id="confirm_result">  </p>
<br>
<button id="show_prompt" onclick="ClickPrompt()">提示信息</button>
<p id="prompt_result">  </p>

</body>
</html>